load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "rowcodec",
    srcs = [
        "common.go",
        "decoder.go",
        "encoder.go",
        "row.go",
    ],
    importpath = "github.com/pingcap/tidb/util/rowcodec",
    visibility = ["//visibility:public"],
    deps = [
        "//kv",
        "//parser/model",
        "//parser/mysql",
        "//parser/terror",
        "//parser/types",
        "//sessionctx/stmtctx",
        "//types",
        "//util/chunk",
        "//util/codec",
        "@com_github_pingcap_errors//:errors",
    ],
)

go_test(
    name = "rowcodec_test",
    timeout = "short",
    srcs = [
        "bench_test.go",
        "main_test.go",
        "rowcodec_test.go",
    ],
    embed = [":rowcodec"],
    flaky = True,
    deps = [
        "//kv",
        "//parser/model",
        "//parser/mysql",
        "//sessionctx/stmtctx",
        "//tablecodec",
        "//testkit/testsetup",
        "//types",
        "//util/benchdaily",
        "//util/chunk",
        "//util/codec",
        "//util/collate",
        "@com_github_stretchr_testify//require",
        "@org_uber_go_goleak//:goleak",
    ],
)
